package ca.skygazer.shared.telescope;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@SuppressWarnings("serial")
@PersistenceCapable(detachable="true")
public class TelescopeModel implements Serializable {

	@SuppressWarnings("unused")
	@PrimaryKey	
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String encodedKey;

    @Persistent
    private String name;
    @Persistent
    private String brand;
    @Persistent
	private double focalLength;
    @Persistent
	private double aperatureDiameter;

    public TelescopeModel(){
    }
    
	public Telescope getTelescope(){
		Telescope telescope = new Telescope();
		telescope.setTelescopeModel(this);
		return telescope;
	}

	
	// Getters and Setters
	public double getFocalLength() {
		return focalLength;
	}
	public void setFocalLength(double focalLength) {
		this.focalLength = focalLength;
	}
	public double getAperatureDiameter() {
		return aperatureDiameter;
	}
	public void setAperatureDiameter(double aperatureDiameter) {
		this.aperatureDiameter = aperatureDiameter;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	
	
}
